package com.qqt.csr.ixport.vo.req;

import com.qqt.csr.common.idempotent.RequestKeyParam;
import com.qqt.csr.common.operalog.OperaLogSchema;
import com.qqt.csr.ixport.enums.TaskType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @Author: yang hao
 * @Date: 2025/1/20 9:25
 * @Description: 批量导入任务新增请求参数
 **/
@Data
@Schema(name = "CreatingImportTaskReqVO", description = "批量导入任务新增请求参数")
public class CreatingImportTaskReqVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "任务名称不能为空")
    @OperaLogSchema(desc = "任务名称")
    private String name;

    /**
     * 任务类型：SW 敏感词导入
     */
    @Schema(description = "任务类型：SENSITIVE_WORDS 敏感词导入", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "任务类型不能为空")
    @OperaLogSchema(desc = "任务类型")
    private TaskType type;

    /**
     * 服务编码，任务消费服务对应编码
     */
    @Schema(description = "服务编码，任务消费服务对应编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "服务编码不能为空")
    @OperaLogSchema(desc = "服务编码")
    private String businessCode;

    /**
     * 重试次数配置
     */
    @Schema(description = "重试次数配置, 默认为3")
    private Integer retryTimesCfg=3;

    /**
     * 数据源下载地址
     */
    @Schema(description = "数据源下载地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "数据源下载地址不能为空")
    @RequestKeyParam
    private String dataSourceDownUrl;

}
